import { Game } from "./Game";
import { SquareGroup } from "./SquareGroup";

export interface IPoint {
  readonly x: number;
  readonly y: number;
}

export interface IViewer {
  /**
   * 显示
   */
  show: () => void;

  /**
   * 移除
   */
  remove: () => void;
}

export type Shape = IPoint[];

export interface GameViewer {
  /**
   * 显示下一个方块
   */
  showNextTetris(tetris: SquareGroup): void;

  /**
   * 切换方块
   */
  removeNextTetris(tetris: SquareGroup): void;

  /**
   * 初始化游戏
   */
  init(game: Game): void;

  /**
   * 开始游戏
   */
  onStart(): void;

  /**
   * 暂停游戏
   */
  onPause(): void;

  /**
   * 结束游戏
   */
  onOver(): void;

  /**
   * 分数增加
   */
  onScore(score: number): void;
}
